package com.neusoft.databus.policy.dto;

import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.dto.AbstractDTO;
import com.neusoft.databus.policy.enums.PolicyExpType;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 表达式dto
 * 
 * @author naxiang
 */
@Getter
@Setter
@ToString
public class ExpressionDTO extends AbstractDTO {

    /**
     * 
     */
    private static final long serialVersionUID = -6379566868709035204L;
    /**
     * 表达式类型
     */
    @ApiModelProperty(value = "表达式类型", required = true, position = 1)
    @Enumerated(EnumType.STRING)
    @NotNull(message = "表达式类型不能为空")
    private PolicyExpType type;
    /**
     * 表达式
     */
    @ApiModelProperty(value = "表达式", required = true, position = 2)
    @NotBlank(message = "表达式不能为空")
    @Length(max = 1023, message = "表达式不能超过{max}位")
    private String expressionInfo;
    /**
     * 连接符
     */
    @ApiModelProperty(value = "连接符", required = false, position = 3)
    @Length(max = 255, message = "连接符不能超过{max}位")
    private String linkSymbol;
    /**
     * 排序符
     */
    @ApiModelProperty(value = "排序符", required = false, position = 4)
    @NotNull(message = "排序符不能为空")
    @Min(value = 0, message = "排序符不能小于{value}")
    private int sequence = 0;
    /**
     * 拓展属性
     */
    @ApiModelProperty(value = "拓展属性", required = false, position = 5)
    @Length(max = 1023, message = "资源连接信息不能超过{max}位")
    private String extendProperty;
}
